'use strict';

//导入模块
let Koa = require('koa');
let bodyParser = require('koa-bodyparser');

//实例化服务器
let server = new Koa();

//注册post中间件
server.use(bodyParser());

//注册路由
let controller= require('./controllers');
server.use(controller());

//监听端口
let port = 3000;
server.listen(port);
//打印服务器信息
console.log(`http://localhost:${port}`);